package main

import (
	"fmt"
	"github.com/gomodule/redigo/redis"
	"log"
)

func main() {
	conn, err := redis.Dial("tcp", "172.20.0.15:6379")
	if err != nil {
		log.Printf("connect redis fail. %s", err.Error())
		return
	}
	defer conn.Close()

	reply, err := conn.Do("SET", "student_1", "zhangsan")
	if err != nil {
		log.Printf("set data fail. %s", err.Error())
		return
	}
	fmt.Println("reply =", reply)

}
